<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="jpath" value="${pageContext.request.contextPath }"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="${jpath}/static/qd/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${jpath}/static/qd/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="${jpath}/static/qd/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="${jpath}/static/qd/css/nav.css"/>
<link rel="stylesheet" type="text/css" href="${jpath}/static/qd/css/xinwenliebiao.css"/>

<title>新闻列表</title>
</head>
<body>
	<div id="nav" class="backcolor">
		<div class="container">
			<div class="row">
				<div class="col-xs-2"><a href="javascript:void(0);" onclick="history.go(-1)"><img src="${jpath}/static/qd/img/back_white.png" height="20px" width="20px"/></a></div>
				<div class="col-xs-8 white-text">${cname}</div>
				<div class="col-xs-2"></div>
			</div>
		</div>
	</div>
	
	<div class="container set_padding">
		<div class="row">
			<div class="col-xs-1 nav_s_size align_center clear_padding hui-text"></div>
			<div class="col-xs-10 nav_s_size align_center clear_padding hui-text">
				<c:forEach var="n" items="${nuis}" varStatus="status">
					<c:if test="${status.index==0}">
       					<span NewId="${n.id}" class="nava nav_s_size align_center clear_padding hui-text active_title">${n.columnName}</span>
					</c:if>
					<c:if test="${status.index!=0}">
       					<span NewId="${n.id}" class="nava nav_s_size align_center clear_padding hui-text">${n.columnName}</span>
					</c:if>
				</c:forEach> 
			</div>
			<div class="col-xs-1 nav_s_size align_center clear_padding hui-text"></div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-xs-12 clear_padding">
				<div id="myCarousel" class="carousel slide">
					<!-- 轮播（Carousel）指标 -->
					<ol class="carousel-indicators">
						<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
						<li data-target="#myCarousel" data-slide-to="1"></li>
						<li data-target="#myCarousel" data-slide-to="2"></li>
						<li data-target="#myCarousel" data-slide-to="3"></li>
					</ol>   
						<!-- 轮播（Carousel）项目 -->
					<div class="carousel-inner">
						<div class="item active">
							<img src="${jpath}/static/qd/img/f_img1.png" alt="First slide">
            <div class="carousel-caption content_m_text">标题 1</div>
						</div>
						<div class="item">
							<img src="${jpath}/static/qd/img/f_img2.png" alt="Second slide">
            <div class="carousel-caption content_m_text">标题 2</div>
						</div>
						<div class="item">
							<img src="${jpath}/static/qd/img/f_img3.png" alt="Third slide">
            <div class="carousel-caption content_m_text">标题 3</div>
						</div>
						<div class="item">
							<img src="${jpath}/static/qd/img/f_img4.png" alt="Third slide">
            <div class="carousel-caption content_m_text">标题 4</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	
	<div id="content">
	</div>
<script src="${jpath}/js/system_plugins.js"></script>
<script type="text/javascript">
	var jpath = "${jpath}";
	var pasrams={pageNum:1,pageSize:5};	
	var kongzhi = 1;
	var id = $(".active_title").eq(0).attr("NewId");
	$(function(){
		$("#content").loadInfo(pasrams,"${jpath}/qdNews/findByPage?id="+id,jpath);
		$("body").on("click",".info",function(){
		     var _this = $(this);
		     var nid = _this.attr("nid");
		     location.href="${jpath}/qd/newInfo?nid="+nid;
		});
		$(".nava").click(function(){
				kongzhi=1;
				pasrams.pageNum=1;
				var _this = $(this);
				var id = _this.attr("NewId");
				$(".nava").each(function(index,e){
                	$(e).removeClass("active_title");
	            });
	            _this.addClass("active_title");
	            $("#content").children().remove();
				$("#content").loadInfo(pasrams,"${jpath}/qdNews/findByPage?id="+id,jpath);
		});
	});
	$(window).scroll(function () {
		if(kongzhi==1){
			var scrollTop = $(this).scrollTop();
			var scrollHeight = $(document).height();
			var windowHeight = $(this).height();
			if (scrollTop + windowHeight == scrollHeight) {
			//此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
			pasrams.pageNum+=1;
			$("#content").loadInfo(pasrams,"${jpath}/qdNews/findByPage?id="+id,jpath);
		}
		}
   }); 
</script>
</body>
</html>
